import Controller from "./Controller";
import {Request,Response} from 'express';
import PageJson from "../utils/PageJson";


/**
 * 项目页面
 */
class TplPages extends Controller
{
    constructor(req?:Request,res?:Response) {
        super(req,res);
    }

    /**
     * 获取项目所有页面
     */
    async getPages()
    {
        const {dir} = await this.first("tpl",{
            id: this.HD.tpl_id
        }) as { dir:string }
        const pages = PageJson.get(dir,"pages")
        this.response(200,pages)
    }

}

export default TplPages